# distribute_configuration.pm
# Copyright (C) 2006, 2007  Stephane Alnet
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 

#
# For more information visit http://carrierclass.net/
#
use strict; use warnings;

package CCNCore::Provision::CDN::distribute_configuration;
use base qw(CCNCore::Provision::CDN);

use CCNCore::Provisioning::Local;
use CCNCore::create_sqlite;

sub cdn_files($)
{
    my $self = shift;
    my $cdn_server = shift;

    $self->die("INTERNAL ERROR") if not defined $cdn_server;

    my $system = $self->sql_get(<<'SQL',$cdn_server);
        SELECT system FROM server WHERE pk = ?
SQL
    $self->die("Could not find system for cdn_server $cdn_server")
        if not defined $system;

    return ([CCNCore::create_sqlite::system_file($system),$CCNCore::Provisioning::Local::_name]);
}

sub edge_files($)
{
    my $self = shift;
    my $edge_server = shift;

    return ($CCNCore::Provisioning::Local::_name);
}

sub what() { return 'configuration' }

1;